﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Y2.Filters;

namespace Y2.Controllers
{
    //[LoginFilter]
    public class usersolController : Controller
    {
        private readonly Iusers he;

        public usersolController(Iusers he)
        {
            this.he = he;
        }

        public IActionResult usersol()
        {
            return View();
        }
        //角色查询
        public async Task<IActionResult> usersols(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.users(currentPage, pageSize)));
        }
        //可用职位查询
        public async Task<string> vs()
        {
            return await he.vs(); ;
        }
        //角色添加
        public async Task<int> Insert(users users)
        {
            return await he.Insert(users);
        }
        //角色修改
        public async Task<int> Update(users users)
        {
            return await he.Update(users);
        }
        //角色删除
        public async Task<int> Delt(users users)
        {
            return await he.Delt(users);
        }
    }
}
